package com.luochen.cdpt.controller;

import com.luochen.cdpt.eneity.Page;
import com.luochen.cdpt.response.RespBean;
import com.luochen.cdpt.eneity.TeamInfo;
import com.luochen.cdpt.service.TeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @Auther: star
 * @Date: 2018/12/16 12:33
 * @Description:
 */
@RestController
public class TeamController {
    @Autowired
    private TeamService teamService;

    /**
     * 根据条件查询团队信息
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/team/list",method = RequestMethod.GET )
    public Page<Map> list(HttpServletRequest request) {
        return  teamService.list(request);
    }

    /**
     * 保存团队
     * @param teamInfo
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/team/save",method = RequestMethod.POST )
    public RespBean save(@RequestBody TeamInfo teamInfo){
        return teamService.save(teamInfo);
    }
}
